// adapter/rest/BatchImportController.java
package com.library.bookservice.adapter.rest;

import com.library.bookservice.application.service.BatchImportService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * 批量导入REST控制器
 * 处理批量导入相关的HTTP请求
 */
@RestController
@RequestMapping("/api/v1/books")
public class BatchImportController {

    private final BatchImportService batchImportService;

    public BatchImportController(BatchImportService batchImportService) {
        this.batchImportService = batchImportService;
    }

    @PostMapping("/batch-import")
    public ResponseEntity<BatchImportResponse> batchImport(@RequestBody BatchImportRequest request) {
        BatchImportResponse response = batchImportService.importBooks(request);
        return ResponseEntity.ok(response);
    }
}